package com.study.ktandroid

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.study.ktandroid.coroutines_apply.CoroutinesVSCallbackActivity01
import com.study.ktandroid.coroutines_apply.apply.ui.CoroApplyActivity
import com.study.ktandroid.databinding.ActivityKtAndroidBinding
import org.jetbrains.anko.sdk27.coroutines.onClick
import org.jetbrains.anko.startActivity

/**
 * <pre>
 *     author : slx
 *     time   : 2021/02/02
 *     desc   : kt在android中的应用
 * </pre>
 */
class KtAndroidActivity : AppCompatActivity() {

    lateinit var binding: ActivityKtAndroidBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityKtAndroidBinding.inflate(layoutInflater)

        binding.apply {
            btnCoroExam.onClick {
                startActivity<CoroutinesVSCallbackActivity01>()
            }

            btnCoroApply.onClick {
                startActivity<CoroApplyActivity>()
            }
        }
    }
}